/**
 * @Author: 魏巍 <jswei>
 * @Date:   2018-08-10T20:59:06+08:00
 * @Email:  524314430@qq.com
 * @Filename: index.js
 * @Last modified by:   jswei
 * @Last modified time: 2018-08-28T04:33:24+08:00
 * @Copyright: free
 */

import Vue from 'vue'
import Vuex from 'vuex'
import createPersist, { createStorage } from 'vuex-localstorage'

import mutations from './mutations'
import actions from './actions'

Vue.use(Vuex);

export default new Vuex.Store({
    modules: {
        mutations
    },
    actions,
    plugins: [
        createPersist({
            namespace: 'namespace-for-state',
            initialState: {},
            // ONE_WEEK
            expires: 7 * 24 * 60 * 60 * 1e3
        })
    ]
});
